//
//  YSMineDataTool.h
//  Yueshi
//
//  Created by yueshi_tech on 15/7/15.
//  Copyright (c) 2015年 悦食中国. All rights reserved.
//

#import "BaseDataTool.h"
#import "YSRegisterRes.h"
#import "YSAddressRes.h"
#import "YSOrderListRes.h"
#import "YSOrderDetailRes.h"
#import "YSOrderDeliveryRes.h"
#import "YSFeedbackRes.h"
#import "YSNewAddressRes.h"
#import "YSVoucherRes.h"
#import "YSValidateVoucherRes.h"
#import "YSReceiveVoucher.h"
#import "YSCustomerServiceRes.h"
#import "YSSendMessageRes.h"


@interface YSMineDataTool : BaseDataTool

/**
 *  注册
 *
 *  @param phoneCode 电话
 *  @param password  密码
 *  @param success
 *  @param failure   
 */
+ (void)registerWithParams:(NSString *)phoneCode password:(NSString *)password success:(void(^)(YSRegisterRes *result))success failure:(void(^)(NSError *error))failure;
/**
 *  登录
 *
 *  @param phoneCode phone
 *  @param validateCode  validateCode
 *  @param success
 *  @param failure   
 */
+ (void)loginWithParams:(NSString *)phoneCode validateCode:(NSString *)validateCode success:(void(^)(YSRegisterRes *result))success failure:(void(^)(NSError *error))failure;

/**
 *  忘记密码
 *
 *  @param phoneCode    phone
 *  @param password     pwd
 *  @param validateCode 验证码
 *  @param success
 *  @param failure
 */
+ (void)forgetWithParams:(NSString *)phoneCode password:(NSString *)password validateCode:(NSString *)validateCode success:(void(^)(BaseResponse *result))success failure:(void(^)(NSError *error))failure;

/**
 *  发送验证码
 *
 *  @param phoneCode phone
 *  @param type       1 修改密码
 *  @param success
 *  @param failure
 */
+ (void)sendCodeWithParams:(NSString *)phoneCode type:(NSInteger)type success:(void(^)(BaseResponse *result))success failure:(void(^)(NSError *error))failure;

/**
 *  第三方登陆
 *
 *  @param param
 *  @param success
 *  @param failure
 */
+(void)oauthLoginWithParam:(NSDictionary *)param success:(void (^)(YSRegisterRes *result))success failure:(void (^)(NSError *error))failure;

/**
 *  获取地址列表
 */
+ (void)getAddressList:(void (^)(YSAddressRes *result))success failure:(void (^)(NSError *error))failure;

/**
 *  删除地址
 *
 *  @param adresId 地址id
 *  @param success
 *  @param failure
 */
+ (void)deleteAddressWithID:(NSInteger)adresId success:(void (^)(BaseResponse *result))success failure:(void (^)(NSError *error))failure;

/**
 *  新增和修改地址
 *
 *  @param addressee    收件人姓名
 *  @param phoneCode   电话
 *  @param deliveryId  县/区 id
 *  @param detailAdres 详细地址
 *  @param postal      邮编
 *  @param addressId   有值为修改，反之新增
 *  @param success
 *  @param failure
 */
+ (void)addAddressWithAddressee:(NSString *)addressee phoneCode:(NSString *)phoneCode deliveryId:(NSString *)deliveryId detailAdres:(NSString *)detailAdres postal:(NSString *)postal  addressId:(NSInteger)addressId addressStr:(NSString *)addressStr success:(void (^)(YSNewAddressRes *result))success failure:(void (^)(NSError *error))failure;

/**
 *  获取地址列表
 */
+ (void)setDefaultWithAddressId:(NSInteger)addressId success:(void (^)(BaseResponse *result))success failure:(void (^)(NSError *error))failure;

/**
 *  订单列表
 *
 *  @param success
 *  @param failure
 */
+(void)getOrderListWithOrderType:(NSInteger)orderType orderCode:(NSString *)orderCode pageIndex:(NSInteger)pageIndex orderStatus:(NSInteger)orderStatus success:(void(^)(YSOrderListRes *result))success failure:(void(^)(NSError *error))failure;
/**
 *  订单详情
 *
 *  @param orderCode    订单编号
 *  @param success
 *  @param failure
 */
+(void)getOrderDetailWithOrderCode:(NSString *)orderCode success:(void(^)(YSOrderDetailRes *result))success failure:(void(^)(NSError *error))failure;
/**
 *  取消订单
 *
 *  @param orderCode 订单号
 *  @param success
 *  @param failure
 */
+(void)cancleOrderWithOrderCode:(NSString *)orderCode success:(void(^)(BaseResponse *result))success failure:(void(^)(NSError *error))failure;

/**
 *  确认收货
 *
 *  @param orderCode 订单号
 *  @param success
 *  @param failure   
 */
+(void)enterWithOrderCode:(NSString *)orderCode success:(void(^)(BaseResponse *result))success failure:(void(^)(NSError *error))failure;
/**
 *  物流查询
 *
 *  @param orderCode 订单号
 *  @param success
 *  @param failure
 */
+(void)getDeliveryWithOrderCode:(NSString *)orderCode success:(void(^)(YSOrderDeliveryRes *result))success failure:(void(^)(NSError *error))failure;

/**
 *  获取个人中心数据
 *
 *  @param orgUserId    查询的用户id
 *  @param success
 *  @param failure
 */
+(void)getMineInfo:(NSInteger)orgUserId success:(void(^)(YSRegisterRes *result))success failure:(void(^)(NSError *error))failure;
/**
 *  修改头像和昵称,性别
 *
 *  @param imgPath      头像地址
 *  @param nickName     昵称
 *  @param userGender   性别
 *  @param success
 *  @param failure
 */
+(void)updateUserInfo:(NSString *)imgPath nickName:(NSString *)nickName userGender:(NSInteger)userGender success:(void(^)(BaseResponse *result))success failure:(void(^)(NSError *error))failure;
/**
 *  获取消息列表
 *
 *  @param firstId     第一条消息的id
 *  @param messageType 消息类型
 *  @param success
 *  @param failure     
 */
+(void)getMessageList:(NSInteger )firstId messageType:(NSInteger)messageType success:(void(^)(YSFeedbackRes *result))success failure:(void(^)(NSError *error))failure;
/**
 *  发送消息
 *
 *  @param content 内容
 *  @param success
 *  @param failure 
 */
+(void)sendMessage:(NSString *)content messageType:(NSInteger)messageType success:(void (^)(YSSendMessageRes *result))success failure:(void (^)(NSError *error))failure;
/**
 *  获取代金券列表信息
 *
 *  @param success
 *  @param failure
 */
+(void)getVoucherInfo:(void(^)(YSVoucherRes *result))success failure:(void(^)(NSError *error))failure;

/**
 *  验证代金券
 *
 *  @param voucherCode 代金券码
 *  @param success
 *  @param failure
 */
+(void)validateVoucherWithVoucherCode:(NSString *)voucherCode success:(void(^)(YSValidateVoucherRes *result))success failure:(void(^)(NSError *error))failure;
/**
 *  领取代金券
 *
 *  @param entityId
 *  @param success
 *  @param failure
 */
+(void)receiveVoucherWithEntityId:(NSString *)entityId success:(void(^)(YSReceiveVoucher *result))success failure:(void(^)(NSError *error))failure;

/**
 *  获取在线客服问题列表
 *
 *  @param success
 *  @param failure
 */
+(void)getCustomerService:(void(^)(YSCustomerServiceRes *result))success failure:(void(^)(NSError *error))failure;

/**
 *  绑定手机号
 *
 *  @param phoneCode 绑定的手机
 *  @param validateCode 验证码
 *  @param success
 *  @param failure
 */
+(void)bindingPhoneWithPhoneCode:(NSString *)phoneCode validateCode:(NSString *)validateCode success:(void(^)(BaseResponse *result))success failure:(void(^)(NSError *error))failure;

@end
